﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ZP.DTO.Common;
using ZP.DTO.fz_sys_user;
using ZP.Model;

namespace ZP.IBLL
{
    public interface Ifz_sys_userService : IBaseService<fz_sys_user, int>
    {
        /// <summary>
        /// 用户登录
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        UserLoginDTO Login(AccountLoginDTO model);
        /// <summary>
        /// 登录用户错误次数处理
        /// </summary>
        /// <param name="model"></param>
        /// <param name="isSuccess"></param>
        /// <returns></returns>
        int LoginErrorCount(AccountLoginDTO model, bool isSuccess = false);
        /// <summary>
        /// 获得分页数据
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        PageModel<fz_sys_userResultDTO> GetSysUser(fz_sys_userSearchDTO dto);
        /// <summary>
        /// 根据主键ID获得一条数据
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        fz_sys_userResultDTO GetUser(int id);
        /// <summary>
        /// 保存用户信息
        /// </summary>
        /// <param name="dto"></param>
        /// <param name="operate"></param>
        /// <returns></returns>
        bool SaveSysUser(fz_sys_userOperateDTO dto, string operate);
        /// <summary>
        /// 删除用户
        /// </summary>
        /// <param name="dto"></param>
        /// <param name="loginUser"></param>
        /// <returns></returns>
        bool DeleteSysUser(List<fz_sys_userOperateDTO> dto, UserLoginDTO loginUser);
        /// <summary>
        /// 发送验证右键
        /// </summary>
        /// <param name="account"></param>
        /// <returns></returns>
        bool SendVerification(string account);
        /// <summary>
        /// 解码-忘记密码链接
        /// </summary>
        /// <param name="sid"></param>
        /// <param name="account"></param>
        /// <param name="errorMsg"></param>
        /// <returns></returns>
        bool FindPasswordDecrypt(string sid, out string account, out string errorMsg);
        /// <summary>
        /// 保存用户密码
        /// </summary>
        /// <param name="account"></param>
        /// <param name="password"></param>
        /// <returns></returns>
        bool SavePassword(string account, string password);
        /// <summary>
        /// 保存用户头像
        /// </summary>
        /// <param name="id"></param>
        /// <param name="headImg"></param>
        /// <returns></returns>
        bool SaveAvatar(int id, string headImg);
    }
}
